package com.kqb.controller;

import com.kqb.common.controller.base.BaseController;
import com.kqb.common.domain.AjaxResult;
import com.kqb.pojo.Segmentation;
import com.kqb.service.SegmentationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api")
@Api(tags = "用户类别")
public class SegmentationController extends BaseController {

    @Autowired
    SegmentationService segmentationService;

    @PostMapping("/segmentation")
    @ApiOperation("查询用户类别")
    public AjaxResult findAll(@RequestBody Segmentation segmentation){
        List<Segmentation> list = segmentationService.findAll(segmentation);
        return success("查询成功",list);
    }


    @ApiOperation("修改客户类型内容")
    @PutMapping("/segmentation")
    public AjaxResult update(@RequestBody Segmentation segmentation){
        int update = segmentationService.update(segmentation);
        return success("修改成功");
    }


}
